﻿<%template _header%>
<link rel="stylesheet" type="text/css" href="/support/common/vss.css">
<%namespace YouHP.Model%>
<%namespace YouHP.Model.Group%>
<%namespace YouHP.Utility%>

<script type="text/javascript">
    function ChangeDetailStatus()
    {
        if( _$('detail').style.display == 'none')
        {
            _$('detail').style.display = '' ;
            _$('changeDetail').innerText = '关闭详情' ;
        }
        else
        {
            _$('detail').style.display = 'none';
            _$('changeDetail').innerText = '查看详情' ;
        }
    }
</script>


<div class="layout-cols2">
	
	<div class="col1">
		
		<div class="box">
			<div class="caption">
				治疗名称
			</div>
			<div class="content">
				<b>商品名：</b>{TreatmentData.Name} &nbsp;&nbsp; <b>通用名：</b>{TreatmentData.GeneralName}
			</div>
		</div>
		
		<div class="box">
			<div class="caption">
				治疗简介
			</div>
			<div class="content">
				{TreatmentData.Intro}
				<%csharp%>if(TreatmentData.Desp.Length > 0) { <%/csharp%>
				    <div style=" float:right;"><a id="changeDetail" href="javascript:ChangeDetailStatus();" class="yellowbutton">查看详情</a></div> 
				<%csharp%> } <%/csharp%>
				<div style="clear:both;"></div>				
			</div>
		</div>
		
		<div id="detail" class="box" style="display:none">
			<div class="caption">
				治疗描述
			</div>
			<div class="content">
				{TreatmentData.Desp}
				<div style=" float:right;"><a href="javascript:ChangeDetailStatus();" class="yellowbutton">关闭详情</a></div>
				<div style="clear:both;"></div>
			</div>
		</div>		
		<div class="box">
			<div class="caption">
				剂量统计
			</div>
			<div class="content">
			    <br />
			    <div id="dosage"  style="width:700px;height:350px;overflow-x:auto"><img src="/support/alpha/images/indicator_medium.gif" /><b>正在加载……</b></div>
			    <b>注：柱状图上方数字为服用该剂量人数，点击可以显示其病人列表</b>（统计数据以前一天为准）
			</div>
		</div>
	</div>
	
	<div class="col2">
	    <%template _AddTreatment%>
	    <br />
		<%template _DiseaseRelatedForTreatment%>
		<br />
		<%template _PatientRelatedForTreatment%>
		<br />
		<%template _TopicHottestForTreatment%>
	</div>
	
</div>
<script type="text/javascript" src="/support/common/vss.js"></script>
<script type="text/javascript">
function loadJs()
{
	var id = getURLParam("id", location.href);
	
	var url = "/support/data/treatment_stat/treatment_stat_"+id+".js";
	var o = new GetJs(url,load,load);
	o.init();
}
function load()
{
   var data=[];
   var width = 100*treament_dosage.length ; 
   width = width < 600 ? 600 : width ;
   var iIndex = 0 ;
   var id = getURLParam("id", location.href); 
   for(var i=0;i< treament_dosage.length;++i) 
    if(treament_dosage[i][2]>0)
        data[iIndex++] = {name:treament_dosage[i][0], value:treament_dosage[i][1], href:"/Pages/Alpha/PatientList.aspx?trmid="+id+"&startdosage="+treament_dosage[i][2]+"&enddosage="+ (i+1 == treament_dosage.length ? 0 :  treament_dosage[i+1][2])};
    if (data.length == 0 )
    {
        data[0] = {name:"", value:0};
    }
   vmlss({
		element:document.getElementById("dosage"),//这个是绘图时图形放置的容器，可选
		data:data,//数据
		type:"cylinder_h",//cylinder_h表示画柱状图
		calnum:25,//这个表示把竖坐标的刻度划分成25份
		title:'',//这个是图表的标题，可选
		width:width,//这个是整个图的宽度
		height:350,//这个是整个图的高度
		vLabel:"<b>服用该药剂量</b>",//这个是水平坐标的名称，可选
		hLabel:"<b>服用该药不同剂量人数</b>"//这个是垂直坐标的名称，可选
	}).draw();

}
loadJs();
</script>

<%template _footer%>		
